﻿using lazada.Models;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

namespace lazada.DAL
{
    public class ListFloorDAL:ConnectionDB
    {
        public ListFloorDAL(): base()
        {

        }

        public List<ListModel> ListFloor1()
        {
            List<ListModel> list = new List<ListModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T1";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while(dr.Read())
            {
                ListModel lisFl = new ListModel();

                lisFl.listleft = dr["Name"].ToString();

                list.Add(lisFl);
            }
            Connection.Close();
            return list;
        }
        public List<ListModel> ListFloor2()
        {
            List<ListModel> list = new List<ListModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T2";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ListModel lisFl = new ListModel();

                lisFl.listleft = dr["Name"].ToString();

                list.Add(lisFl);
            }
            Connection.Close();
            return list;
        }
        public List<ListModel> ListFloor3()
        {
            List<ListModel> list = new List<ListModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T3";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ListModel lisFl = new ListModel();

                lisFl.listleft = dr["Name"].ToString();

                list.Add(lisFl);
            }
            Connection.Close();
            return list;
        }
        public List<ListModel> ListFloor4()
        {
            List<ListModel> list = new List<ListModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T4";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ListModel lisFl = new ListModel();

                lisFl.listleft = dr["Name"].ToString();

                list.Add(lisFl);
            }
            Connection.Close();
            return list;
        }
        public List<ListModel> ListFloor5()
        {
            List<ListModel> list = new List<ListModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T5";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ListModel lisFl = new ListModel();

                lisFl.listleft = dr["Name"].ToString();

                list.Add(lisFl);
            }
            Connection.Close();
            return list;
        }
        public List<ListModel> ListFloor6()
        {
            List<ListModel> list = new List<ListModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T6";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ListModel lisFl = new ListModel();

                lisFl.listleft = dr["Name"].ToString();

                list.Add(lisFl);
            }
            Connection.Close();
            return list;
        }
        public List<ListModel> ListFloor7()
        {
            List<ListModel> list = new List<ListModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T7";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ListModel lisFl = new ListModel();

                lisFl.listleft = dr["Name"].ToString();

                list.Add(lisFl);
            }
            Connection.Close();
            return list;
        }
        public List<ListModel> ListFloor8()
        {
            List<ListModel> list = new List<ListModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T8";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ListModel lisFl = new ListModel();

                lisFl.listleft = dr["Name"].ToString();

                list.Add(lisFl);
            }
            Connection.Close();
            return list;
        }
        public List<ListModel> ListFloor9()
        {
            List<ListModel> list = new List<ListModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T9";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ListModel lisFl = new ListModel();

                lisFl.listleft = dr["Name"].ToString();

                list.Add(lisFl);
            }
            Connection.Close();
            return list;
        }
        public List<ListModel> ListFloor10()
        {
            List<ListModel> list = new List<ListModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T10";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ListModel lisFl = new ListModel();

                lisFl.listleft = dr["Name"].ToString();

                list.Add(lisFl);
            }
            Connection.Close();
            return list;
        }
        public List<ListModel> ListFloor11()
        {
            List<ListModel> list = new List<ListModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T11";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ListModel lisFl = new ListModel();

                lisFl.listleft = dr["Name"].ToString();

                list.Add(lisFl);
            }
            Connection.Close();
            return list;
        }
        public List<ListModel> ListFloor12()
        {
            List<ListModel> list = new List<ListModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T12";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ListModel lisFl = new ListModel();

                lisFl.listleft = dr["Name"].ToString();

                list.Add(lisFl);
            }
            Connection.Close();
            return list;
        }
        

    }

}